//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.baidu.trace;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import com.baidu.trace.a.a;
import com.baidu.trace.a.d;
import com.baidu.trace.a.f;
import com.baidu.trace.a.h;
import com.baidu.trace.a.i;
import com.baidu.trace.c.e;

public final class bc {
    private Handler a;
    private static final bc b = new bc();

    private bc() {
    }

    protected static bc a() {
        return b;
    }

    protected final void a(Handler var1) {
        this.a = var1;
    }

    protected final void a(d var1) {
        e.d = e.a();
        if(this.a != null) {
            if(1 == var1.a) {
                this.a.obtainMessage(28).sendToTarget();
                return;
            }

            Message var2;
            (var2 = this.a.obtainMessage(30)).arg1 = 1241;
            var2.sendToTarget();
        }

    }

    protected final void a(f var1) {
        z.n = var1.a;
        z.o = var1.i;
        z.w = var1.j;
        z.q = var1.c;
        if(Trace.a == 5 && z.w > ar.c) {
            ar.b = z.w * 1000;
        }

        if(Trace.b == 30 && z.q * 1000 >= ar.b) {
            bd.i = z.q * 1000;
        }

        if(var1.b >= 5) {
            z.p = var1.b;
        }

        z.r = var1.d;
        z.s = var1.e;
        z.t = var1.f;
        z.u = var1.g;
        z.v = var1.h;
        e.d = e.a();
        if(1 == z.n) {
            if(this.a != null) {
                this.a.obtainMessage(29).sendToTarget();
                return;
            }
        } else if(this.a != null) {
            Message var2;
            (var2 = this.a.obtainMessage(30)).arg1 = 1241;
            var2.sendToTarget();
        }

    }

    protected final void a(a var1) {
        e.d = e.a();
        b.a = var1.a;
        if(this.a != null) {
            Message var2;
            (var2 = this.a.obtainMessage(141)).arg1 = 141;
            var2.sendToTarget();
        }

    }

    protected final void a(i var1, long var2) {
        e.d = e.a();
        byte[] var4 = com.baidu.trace.c.d.a(var1.a);
        int var5 = 0;

        for(int var6 = 0; var6 < ay.c.length && var6 < var4.length; ++var6) {
            ay.c[var6] = var4[var6];
            ++var5;
        }

        while(var5 < ay.c.length) {
            ay.c[var5] = 0;
            ++var5;
        }

        ay.d = var1.c;
        ay.e = var1.d;
        ay.b = var1.b;
        ay.a = 1;
        if(ay.d == 1) {
            r.a(ay.e);
            ay.e = null;
        }

        if(this.a != null) {
            Message var8 = this.a.obtainMessage(161);
            Bundle var7;
            (var7 = new Bundle()).putByteArray("ak", ay.c);
            var7.putInt("pushId", ay.b);
            var7.putLong("timeStamp", var2);
            var7.putByte("infoType", ay.d);
            var7.putString("infoContent", ay.e);
            var8.setData(var7);
            var8.sendToTarget();
        }

    }

    protected static void a(h var0) {
        e.d = e.a();
        aw.b(var0.a);
    }

    protected static void b() {
    }

    protected final boolean c() {
        if(this.a == null) {
            return false;
        } else {
            g.b();
            this.a.obtainMessage(31).sendToTarget();
            return true;
        }
    }

    protected final void a(int var1) {
        if(this.a != null) {
            Message var2;
            (var2 = this.a.obtainMessage(32)).arg1 = var1;
            var2.sendToTarget();
        }
    }
}
